<%@ page language="java" contentType="text/html;charset=utf-8"%>
<%
String userName = (String)request.getSession().getAttribute((String)com.wing.common.Constants.SESSION_SITE_USER_NAME);
String userId = (String)request.getSession().getAttribute((String)com.wing.common.Constants.SESSION_SITE_USER_ID);
String type_id = request.getParameter("type_id");
String typen = request.getParameter("typen");
String inforField = request.getParameter("inforField");
%>
<script type="text/javascript">
	function login(){
		opendailog1("{id:'loginwin',src:'stlogin',title:'用户登录',width:400,height:350}");
	}
	function logout(){
		$.ajax({
			url :"<%=request.getContextPath() %>/ext/site_user/logout", //要访问的后台地址
		    type : 'post', //使用get方法访问后台
		    success : function(data){
	   			document.location.reload();
		    }
		});	 
	}
	function zhuce(){
		opendailog1("{id:'loginwin',src:'register',title:'用户注册',width:540,height:380}");
	}
	$.ajax({
		url :"<%=request.getContextPath() %>/sys/code/getCodes", //要访问的后台地址
	    data: "code=<%=com.wing.sys.domain.Code.YBL_TYPE_CODE %>", //要发送的数据
	    type : 'POST', //使用get方法访问后台
	    dataType : 'json', //返回json格式的数据
	    success : function(data){
   			var rows = data; 
   			var select = document.getElementById("selecttype");
	    	$.each(rows, function(i, n){
	    		if(n.code=="<%=type_id==null?"":type_id %>"){
	    			select.options.add(new Option(n.name,n.code,true,true));
	    		}else{
		    		select.options.add(new Option(n.name,n.code));
	    		} 
	        }); 
	    }
	});	

	function changem(type,typen){
		document.location.href="qzzp?type_id="+type+"&typen="+encodeURI(typen);
	}
	
	var mgrmysite = function(){
  		$.ajax({
		   type: "POST",
		   url: "/sys/dispatch",   
		   data: "login_code=ybl_<%=userName %>",
		   dataType: 'json',
		   success: function(data){
		     	if(data.status=="failure"){
					if(data.code=="nosite"){
						alert("对不起您还没有自己的网站！");
					}
				}else{
					window.location="http://"+data.url+"/sys/get/login?a=y&l="+data.l+"&p="+data.p;
				}
		   }
		}); 
	}
	var openmysite = function(){
  		$.ajax({
		   type: "POST",
		   url: "/sys/dispatch",   
		   data: "login_code=ybl_<%=userName %>",
		   dataType: 'json',
		   success: function(data){
		     	if(data.status=="failure"){
					if(data.code=="nosite"){
						alert("对不起您还没有自己的网站！");
					}
				}else{
					window.location="http://"+data.url;
				}
		   }
		}); 
	}
	var openhowtodo = function(){
  		$.ajax({
		   type: "POST",
		   url: "/sys/getcoo",   
		   data: "k=ybl_yiyue",
		   success: function(data){
		   	 if(data!="t"){
		     	$("#howtodo").attr("style","display:block;position:relative;padding:35px 10px 0 18px;width:252px;height:23px;background:url(<%=request.getContextPath() %>/site/${SiteAccessPath}/images/logo_right.gif);");
		     }
		   }
		}); 
	}
	var closehowtodo = function(){
  		$.ajax({
		   type: "POST",
		   url: "/sys/setcoo",   
		   data: "k=ybl_yiyue&v=t",
		   success: function(data){
		     	$("#howtodo").attr("style","display:none;");
		   }
		}); 
	}
	$(function(){
		openhowtodo();
		new Marquee("marhowtodo",0,1,250,20,20,2000,2000,20);
	})
	
</script>
<div class="land">
  <div class="land_main">
  	<span class="left">您好！ 欢迎光临雅宝路信息网</span> <bdo class="left">&nbsp;&nbsp;
  	<%if(userId!=null){
  		%>
  		<%=userName %><a href="#" onclick="logout()" class="cred">退出</a>
  		<a href="#" onclick="mgrmysite()" class="cred">管理我的网站</a>
  		<a href="#" onclick="openmysite()" class="cred">进入我的网站</a>
  		<%
  	}else{
  		%>
  		<a href="#" onclick="login()" class="cred">登录</a><a href="#" onclick="zhuce()" class="cred">免费注册</a>
  	<%
  	} 
  	%>
  	</bdo>
  	<span style="float:right"><a href="xxfb" target="_blank"><b style="color:#ff6c00;font-size:14px">免费发布信息</b></a></span>
  </div>
</div>
<div class="logo" style="position:relative">
	<img src="<%=request.getContextPath() %>/site/${SiteAccessPath}/images/logo.gif"  class="left" />
	<div class="left" id="howtodo" style="display:none">
		<div id="marhowtodo" style="height:20px;line-height:20px">
		<a href="javascript:void(0);" title="雅宝网针对雅宝路人的服务网站">雅宝网针对雅宝路人的服务网站</a><br/>
		<a href="javascript:void(0);" onclick="changem('YBL02','求职招聘');" title="雅宝网为您提供免费求职，免费招聘服务">雅宝网为您提供免费求职，免费招聘服务</a><br/>
		<a href="javascript:void(0);" onclick="changem('YBL01','出租转让');" title="在这里可以获取雅宝路可靠房屋出租，商铺转让等海量信息">在这里可以获取雅宝路可靠房屋出租，商铺转...</a><br/>
		<a href="shzj" title="商户之家让您免费拥有自己的网站">商户之家让您免费拥有自己的网站</a><br/>
		<a href="javascript:void(0);" onclick="changem('YBL03','货运物流');" title="雅宝网的货运物流信息全面可靠，还可以免费发布库房等各种信息">雅宝网的货运物流信息全面可靠，还可以免费...</a><br/>
		<a href="javascript:void(0);" onclick="changem('YBL06','商务中心');" title="商务中心为您的方便出行提供了航空机票，出国签证等便利">商务中心为您的方便出行提供了航空机票...</a><br/>
		<a href="javascript:void(0);" onclick="changem('YBL04','消费娱乐');" title="您可以在这里征婚交友，聚会活动，交换技能等各种生活娱乐">您可以在这里征婚交友，聚会活动，交换...</a><br/>
		<a href="tpk" title="雅宝网为会员整合了各国时尚的服装款式">雅宝网为会员整合了各国时尚的服装款式</a>
		</div>
		<a href="javascript:void(0);" onclick="closehowtodo();" style="position: absolute;right:10px;top: 5px;">X</a>
	</div>
	<div class="logo_search right">
		<form action="search" id="indexsearch_form" method="post" >
			<select name="type_id" id="selecttype" class="left search_select" >
				<option value="">全部</option>
			</select>
	        <input name="inforField" type="text" id="textfield" value="<%=inforField==null?"":inforField %>" class="left search_input" />
			<input type="image"  class="submit" id="button" src="<%=request.getContextPath() %>/site/${SiteAccessPath}/images/search.jpg" />
		</form>
  </div>
</div>

<div class="menu"><a href="index">首页</a><a href="javascript:changem('YBL02','求职招聘')">求职招聘</a><a href="javascript:changem('YBL01','出租转让')">出租转让</a><a href="javascript:changem('YBL03','货运物流')">货运物流</a><a href="javascript:changem('YBL05','跳蚤市场')">跳蚤市场</a><a href="javascript:changem('YBL04','消费娱乐')">消费娱乐</a><a href="javascript:changem('YBL06','商务中心')">商务中心</a><a href="shzj">商户建站</a><span><a href="tpk">图片库</a></span></div>

